Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getTrackingProps incompatibility with React's casing expectations. #138

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

cjcenizal
Copy link
Contributor

@cjcenizal cjcenizal commented Jan 18, 2024

We use the getTrackingProps helper to generate attributes that will be applied to anchor tags. One of these attributes is referrerpolicy. React throws an error because it expects this to be camel-cased as referrerPolicy. However, when this attribute is provided to a React-Router Link component, TypeScript complains because this component's type definition uses HTMLAttributeReferrerPolicy, which expects the spec casing of referrerpolicy.

The solution is to use the casing that's compatible with React and ignore the TS errors.

@cjcenizal cjcenizal requested a review from mrderyk January 18, 2024 17:56
@cjcenizal cjcenizal merged commit 4d058d0 into main Jan 22, 2024
@cjcenizal cjcenizal deleted the bug/fix-tracking-props-type-error branch January 22, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants